#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Xml;
using MCMLXVII.BackEnd.Services.Common.Messages;
using MCMLXVII.Core.Common;

#endregion

namespace MCMLXVII.BackEnd.Services.OrganizationChart.Messages.AdvancedFind
{
    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
    public class msgExtendedOrganizationMemberInfo
    {

        private int _MemberID;
        public int MemberID
        {
            get
            {
                return _MemberID;
            }
            set
            {
                _MemberID = value;
            }

        }

        private string _Description;
        public string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                _Description = value;
            }
        }

        private int _NodeID;
        public int NodeID
        {
            get
            {
                return _NodeID;
            }
            set
            {
                _NodeID = value;
            }
        }

        private int _MemberClass;
        public int MemberClass
        {
            get
            {
                return _MemberClass;
            }
            set
            {
                _MemberClass = value;
            }
        }


        private int _UpdateSequence;
        public int UpdateSequence
        {
            get
            {
                return _UpdateSequence;
            }
            set
            {
                _UpdateSequence = value;
            }
        }


        private stringNameAndValue[] _ClassProperties;
        public stringNameAndValue[] ClassProperties
        {
            get
            {
                return _ClassProperties;
            }
            set
            {
                _ClassProperties = value;
            }
        }

        private int _SecurityProviderID;
        public int SecurityProviderID
        {
            get
            {
                return _SecurityProviderID;
            }
            set
            {
                _SecurityProviderID = value;
            }
        }

        private string _SecurityProviderName;
        public string SecurityProviderName
        {
            get
            {
                return _SecurityProviderName;
            }
            set
            {
                _SecurityProviderName = value;
            }
        }


        private string _LogonName;
        public string LogonName
        {
            get
            {
                return _LogonName;
            }
            set
            {
                _LogonName = value;
            }
        }

        private string _DirectoryIdentifier;
        public string DirectoryIdentifier
        {
            get
            {
                return _DirectoryIdentifier;
            }
            set
            {
                _DirectoryIdentifier = value;
            }
        }

        private string _Language;
        public string Language
        {
            get
            {
                return _Language;
            }
            set
            {
                _Language = value;
            }
        }

        private msgMembershipInfo _RoleMemberID;
        public msgMembershipInfo RoleMemberID
        {
            get
            {
                return _RoleMemberID;
            }
            set
            {
                _RoleMemberID = value;
            }
        }

        private int _HeadNodeID;
        public int HeadNodeID
        {
            get
            {
                return _HeadNodeID;
            }
            set
            {
                _HeadNodeID = value;
            }
        }


        private string _HeadNodeName;
        public string HeadNodeName
        {
            get
            {
                return _HeadNodeName;
            }
            set
            {
                _HeadNodeName = value;
            }
        }

        public msgExtendedOrganizationMemberInfo()
        {

        }

        public msgExtendedOrganizationMemberInfo(int MemberID, string Description, int NodeID, int MemberClass, XmlReader ClassProperties, int SecurityProviderID, string SecurityProviderName, string LogonName, string DirectoryIdentifier, string Language, msgMembershipInfo rolememberID, int updateSequence, int HeadNodeID, string HeadNodeName)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(ClassProperties);
            int count = doc.SelectSingleNode("Properties").ChildNodes.Count;
            if (count == 0)
            {
                _ClassProperties = null;
            }
            else
            {
                _ClassProperties = new stringNameAndValue[count];
                int i = 0;
                foreach (XmlNode n in doc.SelectSingleNode("Properties").ChildNodes)
                {
                    _ClassProperties[i] = new stringNameAndValue(n.Name, n.InnerText);
                    i++;
                }
            }
            _Description = Description;
            _DirectoryIdentifier = DirectoryIdentifier;
            _Language = Language;
            _LogonName = LogonName;
            _MemberClass = MemberClass;
            _MemberID = MemberID;
            _NodeID = NodeID;
            _SecurityProviderID = SecurityProviderID;
            _RoleMemberID = rolememberID;
            _UpdateSequence = updateSequence;
            _HeadNodeID = HeadNodeID;
            _HeadNodeName = HeadNodeName;
            _SecurityProviderName = SecurityProviderName;
        }

    }

    
    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]    
    public class stringNameAndValue
    {
        private string _Name;
        private string _Value;

        public string Name
        { get {return _Name;}
          set { _Name = value; }
        }
        public string Value
        { 
          get {return _Value;}
          set { _Value = value; }
        }

        public stringNameAndValue ()
	    {                    
	    }
    
        public stringNameAndValue (string Name, string Value)
	    {
            _Name = Name;
            _Value = Value;
	    }
    }
}
